<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>喜欢的专栏</title>
</head>

<body>
    <div id="app">
        <script src="../vue.js"></script>
        <h2>请选择你喜欢的专栏</h2>
        <span class="1" v-for="(item, index) in categories" :key="index">
            <input v-model="selectedCategories" :value="item" type="checkbox">
            <label>{{item}}</label>
        </span>
        <ul>
            <li v-for="(item, index) in selectedCategories" :key="index">{{item}}</li>
        </ul>
    </div>

    <script>
        new Vue({
            el: '#app',
            data: {
                categories: ["科幻", "喜剧", "动漫", "冒险", "科技", "军事", "娱乐", "奇闻"],
                selectedCategories: []
            }
        });
    </script>
</body>

</html>